import Axios from "axios";

import {backstageUrl} from "./config.js"
import $ from  'jquery'

// import AMap  from 'AMap'


Axios.defaults.withCredentials = true;

// 巡更——————————————————————————————


//最近一个月巡更日历
export let getPatrolCountRencentMonthApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getPatrolCountRencentMonth", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

//巡更排班

export let getAllPatrolPlanApi = (schoolId) => {
    return (
        Axios.post(backstageUrl+"bigScreenStatistics/getAllPatrolPlan", {
            schoolId:schoolId
        })
    );
}
//近7天巡更完成计划数排名

export let getIndividualPatrolRankApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getIndividualPatrolRank", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//巡更日历工作用时分布
export let getCheckConditionByHourApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getCheckConditionByHour", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//巡更个人完成数/实时巡更
export let getPatrolIndividualCountApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getPatrolIndividualCount", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//巡更日历
export let getPatrolCalendarApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getPatrolCalendar", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//近7天巡更准确率排名
export let getPatrolIndividualCountWeekApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getPatrolIndividualCountWeek", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//巡更\巡检数据

export let getPatrolAndInspectCountApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getPatrolAndInspectCount", {
            params: {
                schoolId:schoolId
            }
        })
    );
};



//____________________巡检

//每日巡检次数 
export let getInspectTimeByDayApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getInspectTimeByDay", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//巡检异常项目分布
export let getTroubleItemAndTimesApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getTroubleItemAndTimes", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//上周班组工作排名
export let getLastInspectClassWorkloadRankApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getLastInspectClassWorkloadRank", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//累计隐患数
export let getDangerousInformationApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getDangerousInformation", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//本周巡检情况
export let inspectClassWorkAllApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/inspectClassWorkAll", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//巡检异常地点排名
export let getTroublePointApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getTroublePoint", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//待处理隐患事件
export let getSafetySceneContentApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"bigScreenStatistics/getSafetySceneContent", {
            params: {
                schoolId:schoolId
            }
        })
    );
};



//——————————————————校外网格

export let getAreaSpecialStudentsDistributeApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getAreaSpecialStudentsDistribute", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
export let getSpecialStudentsDistributeApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getSpecialStudentsDistribute", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//_______________校内网格

//校内网格区域管理人员

export let getGridAllAdminApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getGridAllAdmin", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
export let getGridAllAdminApi2 = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getGridAllAdmin2", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//校内管理员数目
export let getGridNumApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getGridNum", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//校内网格员联系表格
export let getGridAdminInfoApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getGridAdminInfo", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

export let getGridOutAdminForSecurityAdminApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getGridOutAdminForSecurityAdmin", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//
export let getGridDefaultAreaApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"StatisticsForAllSchool/getGridDefaultArea", {
            params: {
                schoolId:schoolId
            }
        })
    );
};





//_____闸机考勤

export let attendanceUserInformationApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"Statistics/attendanceUserInformation", {
            params: {
                schoolId:schoolId
            }
        })
    );
};
//大屏模块配置

//add
export let addModuleConfigApi = (identityId, departmentId, moduleWatch ) => {
    return (
        Axios.post(backstageUrl + "bigScreenConfig/addModuleConfig", {
            identityId: identityId,
            departmentId: departmentId,
            moduleWatch: moduleWatch
        })
    );
}
//find
export let findModuleConfigApi = (departmentId) => {
    return (
        Axios.post(backstageUrl + "bigScreenConfig/findModuleConfig", {
                departmentId: departmentId
        })
    );
}
//update

export let updateModuleConfigApi = (departmentId, moduleWatch) => {
    return (
        Axios.post(backstageUrl + "bigScreenConfig/updateModuleConfig", {
                departmentId: departmentId, 
                moduleWatch:moduleWatch
        })
    );
}
//update 可查看大屏角色
export let updateModuleConfig2Api = (identityId, departmentId,  moduleWatch) => {
    return (
        Axios.post(backstageUrl + "bigScreenConfig/updateModuleConfig2", {
            identityId:identityId,
                departmentId: departmentId, 
             
                moduleWatch:moduleWatch
        })
    );
}

//=========================考勤大屏===========================
export let getStudentAndOtherRoleInOutRecordAboutBigScreenApi = (department) => {
    return (
        Axios.post(backstageUrl+"schoolMangement/getStudentAndOtherRoleInOutRecordAboutBigScreen", {
                department: department, 
        })
    );
}

//分班级显示在校，离校学生
export let getStudentInOutRecordDetailForGradeApi = (department) => {
    return (
        Axios.post(backstageUrl+"schoolMangement/getStudentInOutRecordDetailForGrade", {
                department: department, 
        })
    );
}

//近七天学生进校时间分布
export let getStudentInSchoolTimeDistributeApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"schoolMangement/getStudentInSchoolTimeDistribute", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//近七天学生离校时间分布
export let getStudentOutSchoolTimeDistributeApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"schoolMangement/getStudentOutSchoolTimeDistribute", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//最早到校/最晚离校学生信息
export let getStudentFirstInOrLastOutSchoolTimeApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"schoolMangement/getStudentFirstInOrLastOutSchoolTime", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//今日进出学生信息
export let getAllInOrOutSchoolToDayApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"schoolMangement/getAllInOrOutSchoolToDay", {
            params: {
                schoolId:schoolId
            }
        })
    );
};

//学生进出校次数排名
export let getStudentInOrOutSchoolTimesRankApi = (schoolId) => {
    return (
        Axios.get(backstageUrl+"schoolMangement/getStudentInOrOutSchoolTimesRank", {
            params: {
                schoolId:schoolId
            }
        })
    );
};


//学校名字
export let getSchoolNameByIdApi = (id) => {
    return (
        Axios.get(backstageUrl + "eduDepartmentManagement/getSchoolNameById", {
            params: {
                id:id
            }
        })
    );
};
//导航栏
export let getScreenModuleWatchApi =(id)=>{
    return(
        Axios.get(backstageUrl+"bigScreenConfig/getScreenModuleWatch", {
            params:{
                departmentId:id
            }
        })
    );
};